package o;

import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

public class fjb {
    private fid ˊ;
    private boolean ˋ;
    private fiz ˎ;
    private String ˏ;
    private Object ॱ;

    public fjb(fhz o_fhz, fhw o_fhw) {
        this.ˋ = false;
        if (o_fhw instanceof fiz) {
            this.ˎ = (fiz) o_fhw;
            this.ˊ = new fid(o_fhz.ˋ());
            this.ˏ = o_fhz.ˋ();
            return;
        }
        throw new ClassCastException("apiSpec can not cast to UIModuleSpec");
    }

    public fjb(fhz o_fhz, fjb o_fjb) {
        this(o_fhz, o_fjb.ˋ());
    }

    public <T> T ˊ() {
        if (this.ˎ.ˊ.isInterface()) {
            fjl o_fjl = new fjl(this.ˎ.ˊ);
            this.ॱ = o_fjl;
            return o_fjl.get();
        }
        try {
            this.ॱ = this.ˎ.ˊ.newInstance();
            return this.ॱ;
        } catch (InstantiationException e) {
            return null;
        } catch (IllegalAccessException e2) {
            return null;
        }
    }

    public Intent ॱ(Context context) {
        ˊ(this.ˊ);
        fjg o_fjg = new fjg(this.ˊ);
        o_fjg.ˎ(this.ॱ);
        o_fjg.ˋ(this.ˎ.ˏ);
        fji o_fji = new fji();
        o_fji.setModule(this.ˏ);
        o_fji.setPackageName(context.getPackageName());
        o_fjg.ॱ(o_fji);
        Intent ˊ = o_fjg.ˊ();
        if (this.ˎ.ˎ() != null) {
            ˊ.setClass(context, this.ˎ.ˎ());
        }
        return ˊ;
    }

    protected void ˊ(Context context, Intent intent) {
        Intent ॱ = ॱ(context);
        if (intent != null) {
            ॱ.fillIn(intent, 0);
        }
        if (ॱ.getFlags() == 0 && !(context instanceof Activity)) {
            ॱ.setFlags(268435456);
        }
        context.startActivity(ॱ);
    }

    protected void ˊ(Context context, Intent intent, int i) {
        Activity activity = (Activity) context;
        Intent ॱ = ॱ(context);
        if (intent != null) {
            ॱ.fillIn(intent, 0);
        }
        Fragment ॱ2 = fiy.ॱ(activity, i);
        if (ॱ2 != null) {
            activity.startActivityFromFragment(ॱ2, ॱ, i);
        }
    }

    protected void ˊ(fid o_fid) {
        fik o_fik = (fik) fih.ˋ(this);
        if (!o_fik.ˊ()) {
            o_fid.add(o_fik.ˏ());
        }
    }

    protected Bundle ˊ(Context context) {
        ˊ(this.ˊ);
        fje o_fje = new fje(this.ˊ);
        o_fje.ˋ(this.ॱ);
        return o_fje.ˎ();
    }

    public boolean ˎ() {
        return this.ˋ;
    }

    public void ॱ(boolean z) {
        this.ˋ = z;
    }

    public fiz ˋ() {
        return this.ˎ;
    }

    public boolean ˏ() {
        return Activity.class.isAssignableFrom(this.ˎ.ˎ());
    }
}
